import {getTradeInfo,postSubmitOrder} from '@/api/order'

const state={
  //交易信息
  tradeInfo:{}
}
const mutations={
  UP_TRADEINFO(state,payload){
    state.tradeInfo=payload
  }
}
const actions={
  //交易页
  async getTradeInfoAsync({commit}){
    const res =await getTradeInfo();
    commit('UP_TRADEINFO',res.data)
  },
  //订单提交
  async postSubmitOrderAsync(context,body){
    const res=await postSubmitOrder(body);
    return res
  }
}

export default {
	namespaced:true,
	state,
	mutations,
	actions
}